package com.appoint.common.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @ClassName:  RELEASE_TYPE
 * @Description: 发放方式.
 * @author baode
 * @date 2021年2月14日 下午3:01:32
 */
public enum RELEASE_TYPE {

    login("1", "登录发放"),
    share_new("2", "邀请新用户发放"),
    point("3", "积分兑换"),
    manage("4", "管理员发放"),
    new_user("5", "新用户发放"),
    spend_give_coupon("6", "花费给予优惠券"),
	recharge_give_coupon("7", "充值给予优惠券");

	private String code;
	private String desc;

	private RELEASE_TYPE(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	private static final Map<String, String> MAP = new HashMap<String, String>();
	static {
		for (RELEASE_TYPE agentType : EnumSet.allOf(RELEASE_TYPE.class)) {
			MAP.put(agentType.getCode(), agentType.getDesc());
		}
	}

	public static String getDesc(String code) {
		return MAP.get(code);
	}
}
